package cn.itsource.org.mapper;

import cn.itsource.org.domain.Employee;
import cn.itsource.org.pojo.dto.LoginDto;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 部门mapper
 */
public interface EmployeeMapper extends Mapper<Employee> {
    //基础方法通过继承得到

    List<Employee> findManager();

    @Select("select * from t_employee where username = #{username} or phone = #{phone} or email = #{email}")
    List<Employee> selectByUsernameOrPhoneOrEmail(Employee admin);

    @Select("select * from t_employee where username = #{username} or phone = #{username} or email = #{username}")
    Employee selectByUsername(LoginDto loginDto);

    @Select("select * from t_employee where shop_id = #{shopId}")
    List<Employee> findShopAllEmployee(Long shopId);
}
